// Learn cc.Class:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/class.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/class/index.html
// Learn Attribute:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/reference/attributes/index.html
// Learn life-cycle callbacks:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/life-cycle-callbacks/index.html

cc.Class({
    extends: cc.Component,

    properties: {
        // foo: {
        //     // ATTRIBUTES:
        //     default: null,        // The default value will be used only when the component attaching
        //                           // to a node for the first time
        //     type: cc.SpriteFrame, // optional, default is typeof default
        //     serializable: true,   // optional, default is true
        // },
        // bar: {
        //     get () {
        //         return this._bar;
        //     },
        //     set (value) {
        //         this._bar = value;
        //     }
        // },
        vertical:9,
        herrisize:10,
        pointperfab:{default:null,type:cc.Prefab},
        contenter:cc.Node,
        distance:50,
        offsetx:-500,
        offsety:400,
        pointList:[],
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        for(var i=0;i<this.vertical;i++){
            for(var j=0;j<this.herrisize;j++){
                var tempsrce=cc.instantiate(this.pointperfab);
                tempsrce.parent=this.contenter;
                tempsrce.setPosition(this.offsetx+i*this.distance,this.offsety-j*(this.distance-1.5));
                var pointcompent=tempsrce.getComponent("Point");
                var tempobj=new Object();
                tempobj.x=i;tempobj.y=j;
                pointcompent.thePoint=tempobj;
                pointcompent.standed=true;
                pointList.push(tempobj);

            }
        }
    },

    start () {

    },

    // update (dt) {},
});
